package com.tsk.base.result;

/**
 * @author: 黄嘉振
 * @create: 2023/3/7 15:43
 * @description:    自定义服务响应码及信息
 **/
public enum ResultEnum implements IResult {
    /**
     * 自定义响应码及响应信息，方便定位问题
     */
    SUCCESS(0000, "接口调用成功"),
    COMMON_FAILED(9999, "接口调用失败"),
    VALIDATE_FAILED(2002, "参数校验失败"),
    FORBIDDEN(2004, "没有权限访问资源");

    private Integer code;
    private String message;

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }
}
